Skip to content

be: name moneta's exceptions MonetaApiException and Moneta*Exception, one class per file - #85

Merged
landsman merged 1 commit into
mainfrom
be/api-exception-names
Nov 26, 2026
Merged

landsman merged 1 commit into
mainfrom
be/api-exception-names

Conversation

@landsman

Copy link
Copy Markdown
Owner

The leaves read badly once imported directly (catch (InvalidToken e) says neither "exception" nor "MONETA"), so each is now a top-level Moneta*Exception, and the base gains "Api" to match the library's name.

Old New
MonetaException MonetaApiException
MonetaException.InvalidToken MonetaInvalidTokenException
MonetaException.RateLimited MonetaRateLimitedException
MonetaException.HttpError MonetaHttpErrorException
MonetaException.NoAnswer MonetaNoAnswerException
MonetaException.InvalidResponse MonetaInvalidResponseException

MonetaApiException is still abstract sealed over RuntimeException, now with an explicit permits list. Constructors, accessors and javadoc are unchanged; the leaves live in cz.insuit.moneta beside it.

Breaking for 0.x callers. Migrate by renaming imports and the catch clauses, assertThrows and switch cases that name the old types; nothing else about them moved. The repo keeps no changelog, so this body is the record.

Checked with make build (formatting, Error Prone and NullAway at -Werror, tests, Jackson floor run, dependency analysis, and the testing/ and examples/ projects): BUILD SUCCESSFUL. git grep finds no MonetaException and no MonetaException.<Leaf> left.

@landsman
landsman merged commit 5e7336a into main Nov 26, 2026
7 checks passed
@landsman
landsman deleted the be/api-exception-names branch November 26, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant